<%@page import="com.hamizhong.iflowers.web.vo.GoodsVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.FlowerCountVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.FlowerFloridVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.TargetVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.FestivalVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.PurposeVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.ColorVO"%>
<%@page import="com.hamizhong.iflowers.web.vo.VarietyVO"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="../common/common.jsp" %>
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/cat_slider.css">
<title>Hami鲜花-鲜花分类搜索</title>
</head>
<%
	List<VarietyVO> myVarietyVOList = (List<VarietyVO>)request.getAttribute("myVarietyVOList");
	List<ColorVO> myColorVOList = (List<ColorVO>)request.getAttribute("myColorVOList");
	List<PurposeVO> myPurposeVOList = (List<PurposeVO>)request.getAttribute("myPurposeVOList");
	List<FestivalVO> myFestivalVOList = (List<FestivalVO>)request.getAttribute("myFestivalVOList");
	List<TargetVO> myTargetVOList = (List<TargetVO>)request.getAttribute("myTargetVOList");
	List<FlowerFloridVO> myFlowerFloridVOList = (List<FlowerFloridVO>)request.getAttribute("myFlowerFloridVOList");
	List<FlowerCountVO> myFlowerCountVOList = (List<FlowerCountVO>)request.getAttribute("myFlowerCountVOList");
	List<GoodsVO> goodsVOList = (List<GoodsVO>)request.getAttribute("goodsVOList");
	
	String varietyId = (String)request.getAttribute("varietyId");
	String colorId = (String)request.getAttribute("colorId");
	String purposeId = (String)request.getAttribute("purposeId");
	String festivalId = (String)request.getAttribute("festivalId");
	String targetId = (String)request.getAttribute("targetId");
	Integer flowerFloridId = (Integer)request.getAttribute("flowerFloridId");
	Integer flowerCountId = (Integer)request.getAttribute("flowerCountId");
	
%>
<body>
	<%@include file="frame/top.jsp" %>
	<div class="main_div">
		<%@include file="frame/navigation.jsp" %>
		<div style="width: 990px;height: auto;margin: 0 auto;overflow: hidden;">
			<!-- 分类 -->
			<div style="width: 170px;height: 375px;float: left;border: 1px solid #CCC;">
				<div class="cat_sidebar" style="height: 250px;">
					<ul class="cat_submain" style="width: 170px;">
						<h2 style="background: none repeat scroll 0 0 #FF4326;color: #FFFFFF;font-size: 14px;font-weight: bold;height: 27px;line-height: 27px;padding: 0 10px;margin-bottom: 10px;">
							<font style="margin-left: 10px;">全部商品分类</font>
						</h2>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">新鲜花材</a>
							<div class="small">
								<%
									for(int i=0;i<myVarietyVOList.size();i++) {
										VarietyVO varietyVO = myVarietyVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?varietyId=<%=varietyVO.getVarietyId() %>" onfocus="this.blur();"><%=varietyVO.getVarietyName() %></a>
								<%
									}
								%>
							</div>
						</li>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">鲜花颜色</a>
							<div class="small">
								<%
									for(int i=0;i<myColorVOList.size();i++) {
										ColorVO colorVO = myColorVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?colorId=<%=colorVO.getColorId() %>" onfocus="this.blur();"><%=colorVO.getColorName() %></a>
								<%
									}
								%>
							</div>
						</li>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">鲜花用途</a>
							<div class="small">
								<%
									for(int i=0;i<myPurposeVOList.size();i++) {
										PurposeVO purposeVO = myPurposeVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?purposeId=<%=purposeVO.getPurposeId() %>" onfocus="this.blur();"><%=purposeVO.getPurposeName() %></a>
								<%
									}
								%>
							</div>
						</li>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">节日分类</a>
							<div class="small">
								<%
									for(int i=0;i<myFestivalVOList.size();i++) {
										FestivalVO festivalVO = myFestivalVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?festivalId=<%=festivalVO.getFestivalId() %>" onfocus="this.blur();"><%=festivalVO.getFestivalName() %></a>
								<%
									}
								%>
							</div>
						</li>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">赠送对象</a>
							<div class="small">
								<%
									for(int i=0;i<myTargetVOList.size();i++) {
										TargetVO targetVO = myTargetVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?targetId=<%=targetVO.getTargetId() %>" onfocus="this.blur();"><%=targetVO.getTargetName() %></a>
								<%
									}
								%>
							</div>
						</li>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">花语含义</a>
							<div class="small">
								<%
									for(int i=0;i<myFlowerFloridVOList.size();i++) {
										FlowerFloridVO flowerFloridVO = myFlowerFloridVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?flowerFloridId=<%=flowerFloridVO.getFlowerFloridId() %>" onfocus="this.blur();"><%=flowerFloridVO.getFlowerFloridName() %></a>
								<%
									}
								%>
							</div>
						</li>
						<li onmouseout="unshow_divb(this);" onmouseover="show_divb(this);">
							<a href="#" onfocus="this.blur();">成花支数</a>
							<div class="small">
								<%
									for(int i=0;i<myFlowerCountVOList.size();i++) {
										FlowerCountVO flowerCountVO = myFlowerCountVOList.get(i);
								%>
									<a href="<%=request.getContextPath() %>/goodsSearchByType.action?flowerCountId=<%=flowerCountVO.getFlowerCountId() %>" onfocus="this.blur();"><%=flowerCountVO.getFlowerCountName() %></a>
								<%
									}
								%>
							</div>
						</li>
					</ul>
				</div>
				<div style="width: 100%;height: 100px;padding: 10px;">
					<img width="150px" alt="" src="<%=request.getContextPath() %>/images/pages/client/menu_buttom_ad.gif">
				</div>
			</div>
			
			<!-- 筛选区 -->
			<div style="float: right;width: 800px;height: auto;margin: 0 auto;overflow: hidden;">
				<div style="width: 100%;height: 30px;line-height: 30px;background: none repeat scroll 0 0 #EFEFEF;border: 1px solid #CCCCCC;">
					<font style="font-weight: bold;margin-left: 5px;">筛选条件</font>
				</div>
				<div id="itemListDiv" style="width: 798px;height: 200px;border: 1px solid #CCC;border-top: 0;padding-left: 5px;">
					<div style="width: 100%;height: 30px;line-height: 30px;border-bottom: 1px dashed #CCC;">
						<font style="font-weight: bold;">花材：</font>
						<%
							for(int i=0;i<myVarietyVOList.size();i++) {
								VarietyVO varietyVO = myVarietyVOList.get(i);
								if(varietyVO.getVarietyId().equals(varietyId)) {
						%>
							<font style="background-color: green;font-weight: bold;color: white;"><%=varietyVO.getVarietyName() %></font>
						<%
								}else {
						%>
							<a href="<%=request.getContextPath() %>/goodsSearchByType.action?varietyId=<%=varietyVO.getVarietyId() %>" onfocus="this.blur();"><%=varietyVO.getVarietyName() %></a>
						<%
								}
							}
						%>
					</div>
					<div style="width: 100%;height: 30px;line-height: 30px;border-bottom: 1px dashed #CCC;">
						<font style="font-weight: bold;">颜色：</font>
						<%
							for(int i=0;i<myColorVOList.size();i++) {
								ColorVO colorVO = myColorVOList.get(i);
								if(colorVO.getColorId().equals(colorId)) {
						%>
							<font style="background-color: green;font-weight: bold;color: white;"><%=colorVO.getColorName() %></font>
						<%
								}else {
						%>
							<a href="<%=request.getContextPath() %>/goodsSearchByType.action?colorId=<%=colorVO.getColorId() %>" onfocus="this.blur();"><%=colorVO.getColorName() %></a>
						<%
								}
							}
						%>
					</div>
					<div style="width: 100%;height: 30px;line-height: 30px;border-bottom: 1px dashed #CCC;">
						<font style="font-weight: bold;">用途：</font>
						<%
							for(int i=0;i<myPurposeVOList.size();i++) {
								PurposeVO purposeVO = myPurposeVOList.get(i);
								if(purposeVO.getPurposeId().equals(purposeId)) {
						%>
							<font style="background-color: green;font-weight: bold;color: white;"><%=purposeVO.getPurposeName() %></font>
						<%
								}else {
						%>
							<a href="<%=request.getContextPath() %>/goodsSearchByType.action?purposeId=<%=purposeVO.getPurposeId() %>" onfocus="this.blur();"><%=purposeVO.getPurposeName() %></a>
						<%
								}
							}
						%>
					</div>
					<div style="width: 100%;height: 30px;line-height: 30px;border-bottom: 1px dashed #CCC;">
						<font style="font-weight: bold;">节日：</font>
						<%
							for(int i=0;i<myFestivalVOList.size();i++) {
								FestivalVO festivalVO = myFestivalVOList.get(i);
								if(festivalVO.getFestivalId().equals(festivalId)) {
						%>
							<font style="background-color: green;font-weight: bold;color: white;"><%=festivalVO.getFestivalName() %></font>
						<%
								}else {
						%>
							<a href="<%=request.getContextPath() %>/goodsSearchByType.action?festivalId=<%=festivalVO.getFestivalId() %>" onfocus="this.blur();"><%=festivalVO.getFestivalName() %></a>
						<%
								}
							}
						%>
					</div>
					<div style="width: 100%;height: 30px;line-height: 30px;border-bottom: 1px dashed #CCC;">
						<font style="font-weight: bold;">对象：</font>
						<%
							for(int i=0;i<myTargetVOList.size();i++) {
								TargetVO targetVO = myTargetVOList.get(i);
								if(targetVO.getTargetId().equals(targetId)) {
						%>
							<font style="background-color: green;font-weight: bold;color: white;"><%=targetVO.getTargetName() %></font>
						<%
								}else {
						%>
							<a href="<%=request.getContextPath() %>/goodsSearchByType.action?targetId=<%=targetVO.getTargetId() %>" onfocus="this.blur();"><%=targetVO.getTargetName() %></a>
						<%
								}
							}
						%>
					</div>
					<div style="width: 100%;height: 30px;line-height: 30px;">
						<font style="font-weight: bold;">支数：</font>
						<%
							for(int i=0;i<myFlowerCountVOList.size();i++) {
								FlowerCountVO flowerCountVO = myFlowerCountVOList.get(i);
								if(flowerCountVO.getFlowerCountId().equals(flowerCountId)) {
						%>
							<font style="background-color: green;font-weight: bold;color: white;"><%=flowerCountVO.getFlowerCountName() %></font>
						<%
								}else {
						%>
							<a href="<%=request.getContextPath() %>/goodsSearchByType.action?flowerCountId=<%=flowerCountVO.getFlowerCountId() %>" onfocus="this.blur();"><%=flowerCountVO.getFlowerCountName() %></a>
						<%
								}
							}
						%>
					</div>
					
				</div>
				<div style="clear: both;width: 100%;height: 10px;"></div>
			</div>
			
			<!-- 商品列表 -->
			<div style="float: right;width: 800px;height: auto;margin: 0 auto;overflow: hidden;">
				<div style="width: 100%;height: 30px;line-height: 30px;background: none repeat scroll 0 0 #EFEFEF;border: 1px solid #CCCCCC;">
					<font style="font-weight: bold;margin-left: 5px;">搜索结果</font>
				</div>
				<div id="itemListDiv" style="width: 798px;height: auto;overflow: hidden;min-height: 550px;border: 1px solid #CCC;border-top: 0;">
				<%
					if(goodsVOList != null) {
						for(GoodsVO goodsVO: goodsVOList) {
				%>
					<div style="width: 175px;height: 240px;float: left;margin: 10px;border: 1px solid #DDD;">
						<div style="width: 170px;height: 170px;margin: 2px;">
							<a target="_blank" href="<%=request.getContextPath() %>/goodsItem.action?goodsId=<%=goodsVO.getGoodsId() %>"><img  alt="" src="<%=request.getContextPath() %>/<%=goodsVO.getGoodsPictureS()%>"></a>
						</div>
						<div style="width: 170px;height: 30px;line-height: 30px;margin: 2px;margin-top: 10px;text-align: center;">
							<a target="_blank" href="<%=request.getContextPath() %>/goodsItem.action?goodsId=<%=goodsVO.getGoodsId()%>"><%=goodsVO.getGoodsName() %></a>
						</div>
					<%
						if(goodsVO.getIsBargin() == 1) {
					%>
						<div style="width: 170px;height: 25px;line-height: 25px;text-align: center;color: #FF4326;font-weight: bold;">
							<font style="color: #CCC;">￥<%=goodsVO.getGoodsPrice() %>&nbsp;/&nbsp;</font>￥<%=goodsVO.getBarginPrice() %>
						</div>
					<%
						}else {
					%>
						<div style="width: 170px;height: 25px;line-height: 25px;text-align: center;color: #FF4326;font-weight: bold;">
							￥<%=goodsVO.getGoodsPrice() %>
						</div>
					<%
						}
					%>
					</div>
				<%
						}
					}
				%>
				</div>
			</div>
			
		</div>
		<div style="clear: both;width: 100%;height: 30px;"></div>
	</div>
	<%@include file="frame/feet2.jsp" %>
</body>

<script type="text/javascript">
	function show_div(strid) {
		strid.getElementsByTagName('a')[0].className = 'on';
		strid.style.position = "relative";
	}
	function show_divb(strid) {
		strid.getElementsByTagName('a')[0].className = 'onb';
		strid.getElementsByTagName('div')[0].style.display = "block";
		strid.style.position = "relative";
	}
	function show_divc(strid) {
		strid.getElementsByTagName('a')[0].className = 'onc';
		strid.style.position = "relative";
	}
	function unshow_div(strid) {
		strid.getElementsByTagName('a')[0].className = '';
		strid.style.position = "";
	}
	function unshow_divb(strid) {
		strid.getElementsByTagName('a')[0].className = '';
		strid.getElementsByTagName('div')[0].style.display = "";
		strid.style.position = "";
	}
</script>

</html>